Skip to main content
Write a program to Check Leap Year in C++ Language - Program to Check Leap Year in C++
Program to Check Leap Year in C++ Language
#include <iostream>
using namespace std;
int main() {
int Y;
cout << endl << "Enter a particular year = ";
cin >> Y;
if (Y % 400 == 0)
{
cout << endl << Y << " is a leap year." << endl;
}
else if (Y % 100 == 0)
{
cout << endl << Y << " is not a leap year." << endl;
}
else if (Y % 4 == 0)
{
cout << endl << Y << " is a leap year." << endl;
}
else
{
cout << endl << Y << " is not a leap year." << endl;
}
return 0;
}
इस कोड को हमने CODEBLOCK पर बना कर run किया है
Comments
Post a Comment